package com.spa.infrastructure.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spa.application.command.member.AddressesAddCommand;
import com.spa.application.dto.PageResult;
import com.spa.application.dto.member.MemberAddressesDTO;
import com.spa.application.dto.shop.ShopAddressesDTO;
import com.spa.application.query.member.MemberAddressesQuery;
import com.spa.domain.entity.OrderAddress;
import com.spa.domain.entity.UserAddress;
import com.spa.infrastructure.repository.condition.UserAddressCondition;
import com.spa.infrastructure.repository.po.UserAddressPO;
import org.mapstruct.Mapper;
import org.mapstruct.MapperConfig;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
@MapperConfig(unmappedTargetPolicy = ReportingPolicy.WARN)
public interface UserAddressMapperStruct {

    UserAddressMapperStruct INSTANCE = Mappers.getMapper(UserAddressMapperStruct.class);


    PageResult<MemberAddressesDTO> entity2MemberDto4Page(Page<UserAddress> entity);


    UserAddress po2Entity(UserAddressPO po);
    List<UserAddress> po2Entity4List(List<UserAddressPO> po);

    Page<UserAddress> po2Entity4Page(Page<UserAddressPO> po);

    UserAddressCondition query2Condition(MemberAddressesQuery query);


    MemberAddressesDTO entity2Dto(UserAddress entity);

    UserAddressPO command2MemberPo(AddressesAddCommand addressesAddCommand);

    ShopAddressesDTO entity2ShopDto(OrderAddress entity);


}
